package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.zzw.BO.DeptBO;
import com.ruoyi.common.core.domain.zzw.TPeopleManage;
import com.ruoyi.common.core.domain.zzw.VO.GetPeopleListByDeptVO;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TPeopleManageMapper;
import com.ruoyi.system.service.ITPeopleManageService;

/**
 * 【请填写功能名称】Service业务层处理
 * 
 * @author xbx
 * @date 2023-10-20
 */
@Service
public class TPeopleManageServiceImpl implements ITPeopleManageService 
{
    @Autowired
    private TPeopleManageMapper tPeopleManageMapper;

    /**
     * 查询【请填写功能名称】
     * 
     * @param cPeopleId 【请填写功能名称】主键
     * @return 【请填写功能名称】
     */
    @Override
    public TPeopleManage selectTPeopleManageByCPeopleId(Long cPeopleId)
    {
        return tPeopleManageMapper.selectTPeopleManageByCPeopleId(cPeopleId);
    }

    /**
     * 查询【请填写功能名称】列表
     * 
     * @param tPeopleManage 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<TPeopleManage> selectTPeopleManageList(TPeopleManage tPeopleManage)
    {
        return tPeopleManageMapper.selectTPeopleManageList(tPeopleManage);
    }

    /**
     * 新增【请填写功能名称】
     * 
     * @param tPeopleManage 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertTPeopleManage(TPeopleManage tPeopleManage)
    {
        return tPeopleManageMapper.insertTPeopleManage(tPeopleManage);
    }

    /**
     * 修改【请填写功能名称】
     * 
     * @param tPeopleManage 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateTPeopleManage(TPeopleManage tPeopleManage)
    {
        return tPeopleManageMapper.updateTPeopleManage(tPeopleManage);
    }

    /**
     * 批量删除【请填写功能名称】
     * 
     * @param cPeopleIds 需要删除的【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteTPeopleManageByCPeopleIds(Long[] cPeopleIds)
    {
        return tPeopleManageMapper.deleteTPeopleManageByCPeopleIds(cPeopleIds);
    }

    /**
     * 删除【请填写功能名称】信息
     * 
     * @param cPeopleId 【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteTPeopleManageByCPeopleId(Long cPeopleId)
    {
        return tPeopleManageMapper.deleteTPeopleManageByCPeopleId(cPeopleId);
    }

    @Override
    public AjaxResult getListByDept(DeptBO deptBO) {
        List<TPeopleManage> leaders  =tPeopleManageMapper.getLeadersByDept(deptBO);
        List<TPeopleManage> dutys  =tPeopleManageMapper.getDutysByDept(deptBO);
        GetPeopleListByDeptVO vo=new GetPeopleListByDeptVO();
        vo.setLeaders(leaders);
        vo.setDutys(dutys);
        return AjaxResult.success(vo);
    }
}
